<?php
$pdo = new PDO('mysql:host=localhost;dbname=oa5', 'root', '123456');

echo "检查 oa_lawcase 表结构:\n";
$stmt = $pdo->query("DESCRIBE oa_lawcase");
$cols = $stmt->fetchAll();
foreach ($cols as $col) {
    echo "  - " . $col['Field'] . "\n";
}

echo "\n检查是否有数据:\n";
$stmt = $pdo->query("SELECT COUNT(*) AS count FROM oa_lawcase WHERE delete_time = 0");
$count = $stmt->fetchColumn();
echo "  案件数量: $count\n";

if ($count > 0) {
    echo "\n样本数据:\n";
    $stmt = $pdo->query("SELECT id, title, customer_id, status FROM oa_lawcase WHERE delete_time = 0 LIMIT 3");
    while ($row = $stmt->fetch()) {
        echo "  ID: {$row['id']}, 客户ID: {$row['customer_id']}, 状态: {$row['status']}, 标题: {$row['title']}\n";
    }
}
